package demo1;

public class OutClass {
    public int num1 = 1;
    private int num2 = 2;
    public static final int NUM3 = 3;
    public void test() {
        System.out.println("调用OutClass类的test方法");
    }
    //定义内部类
    class InnerClass {
        public int num1 = 1111;
        public int num4 = 4;
        private int num5 = 5;
        public static final int NUM6 = 6;
        public void innertest1() {
            System.out.println("调用InnerClass类的innertest1普通方法");
            System.out.println(num1);
            System.out.println(this.num1);
            System.out.println(OutClass.this.num1);
            System.out.println(num2);
            System.out.println(OutClass.NUM3);
            System.out.println(num4);
            System.out.println(num5);
            System.out.println(InnerClass.NUM6);
            System.out.println(OutClass.InnerClass.NUM6);
        }
        public static void innertest2() {
            System.out.println("调用InnerClass类的innertest2静态方法");
        }
    }
}
